﻿#region GNU GPL Version 3 License

/// Copyright 2013 Shailesh Lolam
/// 
/// This file Request.cs is part of AzEzAuto.
/// 
/// AzEzAuto is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
/// 
/// AzEzAuto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
/// 
/// You should have received a copy of the GNU General Public License along with AzEzAuto. If not, see http://www.gnu.org/licenses/.
/// 
/// History:
/// ______________________________________________________________
/// Created         04-2013             Shailesh Lolam

#endregion
      
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace AzEzAuto.Entities.Requests
{
    public enum OperationType { Create, Update, Deploy, Upgrade, Swap, Change, UpdateStatus, Delete, WalkUpgrade };
    public interface IOperation
    {
        OperationType Operation { get; }
    }

    [XmlRoot("R", Namespace="")]
    public class Request
    {
        /// <summary>
        /// This is the queue message Id used during transition from input queue
        /// </summary>
        [XmlIgnore]
        public string MessageId;
        /// <summary>
        /// This is the queue message Id used during transition from input queue
        /// </summary>
        [XmlIgnore]
        public string PopReceipt;

        /// <summary>
        /// This is the Request Id of the Release Management System. This is used to track the request
        /// </summary>
        [XmlElement("RQID")]
        public string RequestId;

        /// <summary>
        /// 
        /// </summary>
        [XmlElement("CRID")]
        public string CurrentRequestId;

        [XmlElement("SID")]
        public string SubscriptionId;


        [XmlElement("HS")]
        public CloudServiceBase CloudService;

        [XmlElement("DY")]
        public DeploymentBase Deployment;

        [XmlElement("SS")]
        public StorageBase StorageService;

        [XmlElement("ERR")]
        public Error Error;
    }

    [XmlRoot("ERR")]
    public class Error
    {
        [XmlElement("RID")]
        public string RequestId;
        [XmlElement("C")]
        public string Code;
        [XmlElement("M")]
        public string Message;
    }

}
